home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 7
/
Aminet 7 - August 1995.iso
/
Aminet
/
comm
/
tcp
/
Netdial4_0.lha
/
AmiTCP_Netdial4.0
/
hangup.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1980-05-28
|
2KB
|
59 lines
/* Hangup.rexx */
/* */
/* Version 1.0, 7 January 1993, by K. Raquel Sanborn (raquels@uhunix) */
/* Version 1.1, 1 March 1995, by Wes Tatters (wtatters@world.net ) */
/* */
/* An ARexx script that will hangup the phone after killing AmiTCP */
/* */
/* ---------------------------------------------------------------------- */
/* Start the required libraries */
say 'Opening libraries...'
check = addlib('rexxsupport.library', 0, -30, 0)
if (check == 0) then say 'rexxsupport library did not open...'
check = addlib('rexxserdev.library', 0, -30, 0)
if (check == 0) then say 'rexxserdev did not open...'
cr = '0d'x
hanup_str = 'ATH'||cr
/* Kill AmiTCP first */
say 'KILLing AmiTCP via ARexx port...'
address AMITCP
'KILL'
result = delay(200)
/* Open the serial device and talk to the modem */
/* Mine happens to be a 19200 baud Hayes-compatible on serial unit 0 */
say 'Setting up serial device...'
serhandle = SerOpen('serial.device', 0)
check = SerClear(serhandle)
check = SerSetParms(serhandle, 19200, 8, N, 1, 0 )
/* Send +++, wait the send ATH, then exit */
say 'Sending +++'
check = SerWrite(serhandle, '+++', length('+++'))
check = delay(200)
say 'Sending ATH<cr>'
check = SerWrite(serhandle, 'A', 1) /* Send it slow, I have a stupid */
check = delay(2) /* MODEM! */
check = SerWrite(serhandle, 'T', 1)
check = delay(2)
check = SerWrite(serhandle, 'H', 1)
check = delay(2)
check = SerWrite(serhandle, '0', 1)
check = delay(2)
check = SerWrite(serhandle, cr, 1)
check = delay(50)
check = SerClose(serhandle)
say 'Done.'
exit 0